package com.ruoyi.common.wx.service;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.wx.domain.WxUser;
import com.ruoyi.common.wx.domain.vo.WxUserRegisterVo;

import java.io.IOException;

public interface IWxUserService extends IService<WxUser> {
    JSONObject loginOrRegisterByOpenId(String jsCode) throws IOException;
    String getWxPhone(WxUserRegisterVo input) throws IOException;

    Page<WxUser> queyPageByCondition(WxUser wxUser, Page<WxUser> page);

    AjaxResult removeWxUserByTableId(Long[] ids);
    /**
     * 登录 或者 注册
     * @param input
     * @return
     */
    String loginOrRegister(WxUserRegisterVo input) throws IOException;
    AjaxResult loginByOpenId(String openId) throws IOException;
    AjaxResult getUserInfo(String token) throws IOException;

    /**
     * check openId获取用户
     * @param openId
     * @return
     */
    WxUser getByOpenId(String openId);

    /**
     * 注册
     * @param input
     * @return
     */
    String register(WxUser input);

    /**
     * 判断openId是否存在，且是否授权
     * @return
     */
    String checkEmpower(String openId);


}
